package com.imoblife.brainwavestus.oldDownloadFrame;

import com.imoblife.brainwavestus.service.DownLoadSchedulerSystem;

import android.content.Context;
import android.content.Intent;

public class Commmand {

	/**
	 * ����һ����������
	 * 
	 * @param taskName
	 * @param context
	 */
	public static void makeMusicDownloadCommand(String taskName, Context context) {
		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);

		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_DOWNLOAD);
		intent.putExtra(
				DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_DOWNLOAD,
				taskName);
		context.sendBroadcast(intent);
	}

	/**
	 * ����һ��ظ��˵�������
	 * 
	 * @param context
	 */
	public static void makeRestoreTansationCommand(Context context) {
		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_RESTORE_TRANSATION);
		context.sendBroadcast(intent);
	}
	

	/**
	 * ����һ���������ص�����
	 * 
	 * @param taskName
	 * @param context
	 */
	public static void makeMusicReDownLoadCommand(String taskName,
			Context context) {

		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);

		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_REDOWNLOAD);

		intent.putExtra(
				DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_REDOWNLOAD,
				taskName);

		context.sendBroadcast(intent);

	}

	/**
	 * ����һ��ȡ�����ص�����
	 * 
	 * @param taskName
	 * @param context
	 */
	public static void makeMusicCancalCommand(String taskName, Context context) {

		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_CANCEL);
		intent.putExtra(DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_CANCEL,
				taskName);
		context.sendBroadcast(intent);
	}

	public static void makeStopAllDownloadingCommand(Context context) {

		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_STOP_ALL_DOWNLOADING);
		intent.putExtra(DownLoadSchedulerSystem.COMMAND_STOP_ALL_DOWNLOADING,
				"ֹͣ���ؽ��");
		context.sendBroadcast(intent);
	}

	public static void makeStartAllDownloadingCommand(Context context) {

		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_START_ALL_DOWNLOADING);
		intent.putExtra(DownLoadSchedulerSystem.COMMAND_START_ALL_DOWNLOADING,
				"��ʼ��������");
		context.sendBroadcast(intent);
	}

	/**
	 * b���˳����ص��ϵͳ
	 * 
	 * @param taskName
	 * @param context
	 */
	public static void makeExitDownLoadNowCommand(Context context) {

		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_EXIT_DOWNLOAD_NOW);
		intent.putExtra(DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_CANCEL,
				"makeExitDownLoadNowCommand");
		context.sendBroadcast(intent);
	}

	/**
	 * ���ؽ����˳�
	 */
	public static void makeExitDownLoadWaitCommand(Context context) {
		Intent intent = new Intent(
				DownLoadSchedulerSystem.ACT_SCHEDULER_DOWNLAOD);
		intent.putExtra("command",
				DownLoadSchedulerSystem.COMMAND_EXIT_DOWNLOAD_WAIT);
		intent.putExtra(DownLoadSchedulerSystem.COMMAND_RECAIVER_MUSIC_CANCEL,
				"makeExitDownLoadWaitCommand");
		context.sendBroadcast(intent);

	}

}
